package com.rh.controller;

import com.rh.entity.CrmBanner;
import com.rh.service.CrmBannerService;
import com.rh.result.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 首页获取banner数据接口
 */
@RestController
@RequestMapping("/cmsservice/bannerfront")
@Api(tags = "网站首页Banner列表")
public class BannerApiController {
    @Autowired
    private CrmBannerService bannerService;
    /**
     * 获取首页Banner数据
     */
    @GetMapping("getAllBanner")
    @ApiOperation(value = "1.获取首页Banner数据")
    public ResultVo getAllBanner(){
        List<CrmBanner> list=bannerService.selectAllBanner();
        return ResultVo.ok().data("list",list);
    }
}

